#include <stm32l4xx.h>

#include <linux/sched.h>
#include <linux/clockchips.h>
#include <linux/jiffies.h>

static struct clock_event_device hz_clock_event = {
    
};

void __hal_SysTick_Handler(void)
{
    clockevents_handle(&hz_clock_event);
}

void timer_probe(void)
{
    clockevents_config_and_register(&hz_clock_event, SystemCoreClock, 100, 100000);

    HAL_SYSTICK_Config(SystemCoreClock / CONFIG_HZ);

    NVIC_SetPriority(SysTick_IRQn, 0xFF);
}
